package com.sunfeng.chap1;

import java.nio.ByteBuffer;

/**
 * @Author : 孙峰
 * @Description:  如果position 大于新的limit 则position的值就是新的limit
 * @Date : 2021/10/8  10:05
 */
public class Test6 {
    public static void main(String[] args) {
        ByteBuffer byteBuffer = ByteBuffer.wrap(new byte[]{1, 2, 3});

        byteBuffer.limit(1);
        System.out.println(byteBuffer.limit());
        byteBuffer.position(2);
        System.out.println();
        System.out.println(byteBuffer.limit());
    }
}
